<template>
  <div class="service-problem">
    <h4 class="title">热门问题</h4>
    <ul>
      <li v-for="(item, index) in subject" :key="index" @click="handleSkipQuestionDetail(index)">
        <span>{{ item }}</span>
        <span class="arrow"></span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  data() {
    return {
    };
  },
  props: {
    subject: {
      type: Array,
      default() {
        return [];
      },
    },
  },
  methods: {
    handleSkipQuestionDetail(index) {
      this.$router.push('/service/questionDetail')
      this.$emit('handleSkipQuestionDetail',index)
    }
  }
};
</script>
<style lang="less" scoped>
.service-problem {
  .title {
    padding: 25px 20px;
    border-bottom: 1px solid #fbfbfb;
  }
  ul {
    li {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px 20px;
      border-bottom: 1px solid #fbfbfb;
      font-size: 13px;
      color: #666666;
      .arrow {
        width: 8px;
        height: 8px;
        border-top: 1px solid #999999;
        border-right: 1px solid #999999;
        transform: rotate(45deg);
      }
    }
  }
}
</style>